import request from '@/utils/request'

// 获取仪表盘统计数据
export function getDashboardStats() {
  return request({
    url: '/admin/dashboard/stats',
    method: 'get'
  })
}

// 获取资料列表
export function getMaterials(params) {
  return request({
    url: '/admin/materials',
    method: 'get',
    params
  })
}

// 更新资料状态
export function updateMaterialStatus(id, data) {
  return request({
    url: `/admin/materials/${id}/status`,
    method: 'patch',
    data
  })
}

// 删除资料
export function deleteMaterial(id) {
  return request({
    url: `/admin/materials/${id}`,
    method: 'delete'
  })
}

// 获取用户列表
export function getUsers(params) {
  return request({
    url: '/admin/users',
    method: 'get',
    params
  })
}

// 更新用户状态
export function updateUserStatus(id, data) {
  return request({
    url: `/admin/users/${id}/status`,
    method: 'patch',
    data
  })
}

// 获取充值记录
export function getRecharges(params) {
  return request({
    url: '/admin/finance/recharges',
    method: 'get',
    params
  })
}

// 获取消费记录
export function getConsumptions(params) {
  return request({
    url: '/admin/finance/consumptions',
    method: 'get',
    params
  })
}

// 获取操作日志
export function getOperationLogs(params) {
  return request({
    url: '/admin/logs',
    method: 'get',
    params
  })
}